package com.woniu.userassembly.identifycontroller.impl;

import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.util.UUID;

public class Upload {
    public String uploadCard(MultipartFile file){
        String name = UUID.randomUUID().toString() + file.getOriginalFilename();
        try {
            file.transferTo(new File("D:\\testscxz\\"+name));
        } catch (IOException e) {
            e.printStackTrace();
        }
        //String filePath="http://localhost:8080/"+name;
        String filePath="D:\\testscxz\\"+name;
        System.out.println(filePath);
        return filePath;
    }
}
